﻿#ifndef DAGRAPHICSINFO_H
#define DAGRAPHICSINFO_H

#include <QWidget>
#include <QLabel>
#include <QString>
#include <QPaintEvent>
#include <DAFuncTools.h>
#include <QTimer>

#if HAVE_NVIDIA_ML

#include "nvml.h"

#endif

class DAGraphicsInfo : public QWidget
{
    Q_OBJECT
public:
    explicit DAGraphicsInfo(QWidget *parent = nullptr);
    void Refresh();
signals:

protected:
    void paintEvent(QPaintEvent *e);
private:
#if HAVE_NVIDIA_ML
    nvmlReturn_t result;
#endif

    unsigned int device_count, i;

    QLabel LabelGPU;
    QLabel LabelGMEM;

    QLabel GPURate;
    QLabel GMEMRate;


    void setGPUUsed(unsigned int rate);
    void setGMEMUsed(unsigned int rate);

    QTimer *timer;
};

#endif // DAGRAPHICSINFO_H
